﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Xajhzwb
{
    public partial class FormTask : Form
    {
        public FormTask()
        {
            InitializeComponent();
        }

        private void FormTask_Load(object sender, EventArgs e)
        {
            try
            {



            }
            catch (Exception ex)
            {

            }
        }

        private void btnSetGather_Click(object sender, EventArgs e)
        {

        }

        private void btnSetGlobal_Click(object sender, EventArgs e)
        {

        }

        private void btnSetPublishWeb_Click(object sender, EventArgs e)
        {

        }

        private void btnFileBrowser_Click(object sender, EventArgs e)
        {

        }

        private void btnSetDataBase_Click(object sender, EventArgs e)
        {

        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {

        }

        private void btnApply_Click(object sender, EventArgs e)
        {

        }

        private void rboExportWeb_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void rboExportTxt_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void rboExportExcel_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void rboExportAccess_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void rboExportMSSQL_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void rboExportMySql_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void cboTableName_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void chkIsStartTrigger_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void btnAddTask_Click(object sender, EventArgs e)
        {

        }

        private void btnDelTask_Click(object sender, EventArgs e)
        {

        }

        private void btnSetDataBase_Click_1(object sender, EventArgs e)
        {
            FormDataBase formDataBase = new FormDataBase();

            if (this.rboExportAccess.Checked == true)
                formDataBase.FormState = 0;
            else if (this.rboExportMSSQL.Checked == true)
                formDataBase.FormState = 1;
            else if (this.rboExportMySql.Checked == true)
                formDataBase.FormState = 2;

            formDataBase.DataSource = new FormDataBase.ReturnDataSource(GetDataSource);
            formDataBase.ShowDialog();
            formDataBase.Dispose();
        }

        private void GetDataSource(string strDataConn)
        {
            this.txtDataSource.Text = strDataConn;
        }

        private void rboExportWeb_CheckedChanged_1(object sender, EventArgs e)
        {

        }

        private void rboExportTxt_CheckedChanged_1(object sender, EventArgs e)
        {
            if (rboExportTxt.Checked == true)
            {
                this.rboExportExcel.Checked = false;
                this.rboExportAccess.Checked = false;
                this.rboExportMSSQL.Checked = false;
                this.rboExportMySql.Checked = false;
                this.rboExportWeb.Checked = false;

                SetExportFile();

                if (this.txtFileName.Text.Trim() != "")
                {
                    if (this.txtFileName.Text.EndsWith("xls"))
                        this.txtFileName.Text = this.txtFileName.Text.Substring(0, this.txtFileName.Text.Length - 3) + "txt";
                }
            }
        }

        private void SetExportFile()
        {
            this.txtFileName.Enabled = true;
            this.btnFileBrowser.Enabled = true;
            this.chkIsIncludeHeader.Enabled = true;

            groupBoxDataBase.Enabled = false;
            groupBoxWeb.Enabled = false;
        }





    }
}
